package com.ns002.yigou.quote.common.scheduled;

import com.ns002.yigou.quote.service.DatabaseShareTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


/**
 * @Author xu
 * @Date 2017/7/28 0028 上午 10:22
 * 数据库分表表创建定时器
 */
@Component
public class DatabaseShareTableScheduled {

    @Autowired
    private DatabaseShareTableService shareTableService;

    /**
     * 每天创建一次行情表，如果已经创建就不会再创建
     */
    @Scheduled(cron="0 0 0 * * ?")
    public void quoteShareTable(){
        shareTableService.createTable();
    }

}
